﻿using System;
using SQLite;

namespace Data
{
	public enum AircraftType
	{
		Airplane,
		Helicopter,
		Glider
	};

	public class RCObject{
		[PrimaryKey, AutoIncrement]
		public int Id { get; set;}

		[MaxLength(16)]
		public string name { get; set;} 
	}

	[Table("Aircraft")]
	public class Aircraft : RCObject
	{
		[MaxLength(256)]
		public string description {get; set;}

		public AircraftType type { get; set;}

		public int alarmMinutes {get; set;}
		public int alarmSeconds { get; set;}
	}

	[Table("Batteries")]
	public class Battery : RCObject
	{
		public int cellCount { get; set;}
		public int capacity{ get; set;}

		public DateTime created { get; set;}
	}

	[Table("Flights")]
	public class Flight : RCObject
	{
		public int aircraftId { get; set;}
		public int batteryId { get; set;}

		public double flightDurationInSeconds { get; set;}

		public DateTime start {get; set;}
		public DateTime stop { get; set;}

		[MaxLength(256)]
		public string description {get; set;}
	}
}

